package classLoader;

class DeadLoopCLass {
    static {
        if (true) {
            System.out.println(Thread.currentThread() + "Init DeadLoopClass");
            while (true) {

            }
        }
    }
}

public class Ex5 {
    public static void main(String[] args) {
        Runnable script = new Runnable() {
            public void run() {
                System.out.println(Thread.currentThread() + "start");
                DeadLoopCLass dlc = new DeadLoopCLass();
                System.out.println(Thread.currentThread() + "run over");
            }
        };
        Thread thread1 = new Thread(script);
        Thread thread2 = new Thread(script);
        thread1.start();
        thread2.start();
    }
}

/* 
Thread[Thread-0,5,main]start
Thread[Thread-1,5,main]start
Thread[Thread-0,5,main]Init DeadLoopClass

然后一直死循环
*/